package com.general.client.validator;

public class NumberRangeValidator extends AbstractValidator {
	int minValue, maxValue;
	public NumberRangeValidator(int minValue, int maxValue) {
		this.minValue = minValue;
		this.maxValue = maxValue;	
	}
	
	@Override
	public boolean isValid(String validateStr) {
		try{
			int value = Integer.parseInt(validateStr);
			return (value<=maxValue) && (value>=minValue);
		}catch(Exception ex)
		{
			return false;
		}
	}
}
